package ar.edu.utn.frba.disenio.gui.windows;

import org.uqbar.arena.actions.MessageSend;
import org.uqbar.arena.widgets.Button;
import org.uqbar.arena.widgets.Label;
import org.uqbar.arena.widgets.Panel;
import org.uqbar.arena.windows.Dialog;
import org.uqbar.arena.windows.WindowOwner;

import ar.edu.utn.frba.disenio.model.Asiento;

@SuppressWarnings("serial")
public abstract class OperacionConfirmadaWindow extends Dialog<Asiento> {

	public abstract String getOperacion();
	
	public OperacionConfirmadaWindow(WindowOwner owner, Asiento model) {
		super(owner, model);
	}

	@Override
	protected void createFormPanel(Panel mainPanel) {
		this.setTitle("Aterrizar.com");
		
		new Label(mainPanel)
			.setText("El asiento " + this.getModelObject().getNumeroDeAsiento() + " ha sido " + this.getOperacion() + " exitosamente.");
		
		new Button(mainPanel)
			.setCaption("Seguir Buscando")
			.onClick(new MessageSend(this, "close"));
	}

}
